//
// Created by zephyrus on 2024/6/19.
//

#ifndef DATA_STRUCTURE_STATICLIST_H
#define DATA_STRUCTURE_STATICLIST_H

#include "option_config.h"

#define MAX_SIZE 20
#define ElemType char

typedef struct ListNode
{
    ElemType data;
    int cur;  //游标
} ListNode;

//静态链表实际上就是一个结构体数组
typedef ListNode StaticList[MAX_SIZE];

//initization
void InitStaticList(StaticList *space);

/**
 * 申请空间
 * @param space
 * @return
 */
int StaticList_malloc(StaticList *space);

void StaticList_free(StaticList *space, int k);


void StaticList_insert(StaticList *space, ElemType x);

void StaticList_delete(StaticList *space);

void StaticList_show(StaticList *space);

#endif //DATA_STRUCTURE_STATICLIST_H
